package com.cencat.framework.core.constants;

/**
 * 通用常量类
 */
public class CommonConstants {
    
    // HTTP状态码
    public static final int HTTP_OK = 200;
    public static final int HTTP_BAD_REQUEST = 400;
    public static final int HTTP_UNAUTHORIZED = 401;
    public static final int HTTP_FORBIDDEN = 403;
    public static final int HTTP_NOT_FOUND = 404;
    public static final int HTTP_INTERNAL_ERROR = 500;
    
    // 业务状态码
    public static final String SUCCESS_CODE = "SUCCESS";
    public static final String ERROR_CODE = "ERROR";
    public static final String VALIDATION_ERROR = "VALIDATION_ERROR";
    public static final String BUSINESS_ERROR = "BUSINESS_ERROR";
    public static final String SYSTEM_ERROR = "SYSTEM_ERROR";
    
    // 租户相关常量
    public static final String TENANT_ID_HEADER = "X-Tenant-Id";
    public static final String TENANT_CODE_HEADER = "X-Tenant-Code";
    public static final Long DEFAULT_TENANT_ID = 1L;
    public static final String DEFAULT_TENANT_CODE = "default";
    
    // 数据库相关常量
    public static final String TENANT_ID_COLUMN = "tenant_id";
    public static final String CREATE_TIME_COLUMN = "create_time";
    public static final String UPDATE_TIME_COLUMN = "update_time";
    public static final String CREATE_BY_COLUMN = "create_by";
    public static final String UPDATE_BY_COLUMN = "update_by";
    public static final String DELETE_FLAG_COLUMN = "delete_flag";
    
    // 分页相关常量
    public static final int DEFAULT_PAGE_SIZE = 10;
    public static final int MAX_PAGE_SIZE = 100;
    
    // 时间格式
    public static final String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
    public static final String DATE_PATTERN = "yyyy-MM-dd";
    public static final String TIME_PATTERN = "HH:mm:ss";
    
    // 逻辑删除标志
    public static final Integer NOT_DELETED = 0;
    public static final Integer DELETED = 1;
    
    // 状态标志
    public static final Integer STATUS_ENABLED = 1;
    public static final Integer STATUS_DISABLED = 0;
    
    // 排序相关
    public static final String SORT_ASC = "ASC";
    public static final String SORT_DESC = "DESC";
    
    // 缓存相关
    public static final String CACHE_PREFIX = "cencat:";
    public static final long CACHE_DEFAULT_EXPIRE = 3600L; // 1小时
    
    private CommonConstants() {
        // 防止实例化
    }
}